import Vue from 'vue'
import Router from 'vue-router'

import LayoutDemo from '@/components/LayoutDemo'

Vue.use(Router)

export default new Router({
  routes: [    
    {
      path: '/',
      component: LayoutDemo,
      redirect: '/dashboard',
      children: [
        {
          path: 'dashboard',
          component: () => import('@/components/Dashboard'),
          name: 'Dashboard'
        }
      ]
    },

    {
      path: '/login',
      component: () => import('@/components/Login'),
      name: 'Login'
    },

    {
      path: '/404',
      component: LayoutDemo,
      redirect: '/404/index',
      children: [
        {
          path: 'index',
          component: () => import('@/components/404'),
          name: '404'
        }
      ]
    },

    {
      path: '*',
      redirect: '/404'
    }


  ]
})
